<template>
    <base-breadcrumb>
        <template>
            <a-card>
                <titleName title="基础信息填写"></titleName>
                <a-form-model
                    :model="form"
                    :hideRequiredMark="true"
                    :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
                    :wrapperCol="{ lg: { span: 16 }, sm: { span: 16 } }"
                >
                    <a-row :gutter="24">
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="名称：">
                                <span>{{ form.name }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="所属项目：">
                                <span>{{ form.projectName }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="所属公司：">
                                <span>{{ form.projectName }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="发包人全称：">
                                <span>{{ form.developerFullName }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="结构类型：">
                                <span>{{ form.structureType }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="建筑面积：">
                                <span>{{ form.constructionArea }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="送审结算书日期：">
                                <span>{{ form.submitDate }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="审批程序最迟期限：">
                                <span>{{ form.auditLastDate }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="开/竣工时间：">
                                <span>{{ form.startCompletedTime }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="24" :sm="24">
                            <a-form-model-item label="承包范围：">
                                <span>{{ form.undertakeRange }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="合同造价（元）：">
                                <span>{{ form.contractCost }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="实际成本（元）：">
                                <span>{{ form.actCost }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="财务已列报收入（元）：">
                                <span>{{ form.recordIncome }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="已收款（元）：">
                                <span>{{ form.paidFor }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="结算保底值（元）：">
                                <span>{{ form.settleMinAmount }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="其中：设计变更/签证索赔（元）：">
                                <span>{{ form.signClaimAmount }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="结算预估值（元）：">
                                <span>{{ form.settleEstAmount }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="调整后报审值（元）：">
                                <span>{{ form.adjustedAmount }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="8" :sm="8">
                            <a-form-model-item label="潜在违约及反索赔额（元）：">
                                <span>{{ form.breakClaimAmount }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="24" :sm="24">
                            <a-form-model-item
                                label="合同约定结算书报出日期："
                                :labelCol="{ lg: { span: 0 }, sm: { span: 2 } }"
                                :wrapperCol="{ lg: { span: 16 }, sm: { span: 16 } }"
                            >
                                <span>{{ form.reportedDate }}</span>
                            </a-form-model-item>
                        </a-col>
                        <a-col :md="24" :sm="24">
                            <a-form-model-item label="附件：">
                                <div class="f-col">
                                    <span v-for="(item, index) in form.fileInfoVOList" :key="index">
                                        {{ item.fileName }} &nbsp;
                                        <!-- <a @click="check()">查看</a>&nbsp; -->
                                        <a
                                            :href="
                                                '/api/ycloud-file-center/oper/download?access_token=' +
                                                token +
                                                '&fileId=' +
                                                item.fileId
                                            "
                                            >下载</a
                                        >
                                    </span>
                                </div>
                            </a-form-model-item>
                        </a-col>
                    </a-row>
                </a-form-model>
            </a-card>
            <div class="tool-btns mb20 page-btn-right-top">
                <a-button type="primary" @click="closeForm()">关闭</a-button>
            </div>
        </template>
    </base-breadcrumb>
</template>
<script>
import { getProjectTotalApproval } from '@/api/businessAffairs/revenueAndCost'
import Vue from 'vue'
export default {
    name:'a'+Date.now(),
    data() {
        return {
            id: '',
            form: {},
            token: '',
        }
    },
    mounted() {
        this.token = Vue.getAcloudProvider().getAccessToken()
        this.id = this.$route.query.id
        console.log(this.id)
        this.getProjectTotalApproval()
    },
    methods: {
        // 关闭表单
        closeForm() {
            this.$multiTab.close(this.$route.fullpath)
        },
        getProjectTotalApproval() {
            let params = {
                id: this.id,
            }
            getProjectTotalApproval(params).then((res) => {
                this.form = res.data
                console.log(this.form)
            })
        },
    },
}
</script>
<style lang="less" scoped>
@deep: ~'>>>';
.tool-btns {
    display: flex;
    justify-content: flex-end;
    @{deep} .ant-btn + .ant-btn {
        margin-left: 12px;
    }
}
.step-text {
    .ant-steps-item-title {
        width: 168px;
    }
}
.check-box {
    .ant-checkbox-group {
        margin-top: 1.5%;
        display: flex;
        justify-content: space-between;
    }
    .ant-checkbox-group-item {
        position: static !important;
    }
}
.radio-box {
    .ant-radio-wrapper {
        position: static !important;
    }
    .ant-radio-group {
        margin-top: 3% !important;
        display: flex;
    }
}
.f-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
.f-col .ant-form-item-label {
    text-align: left;
}
.title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    font-weight: bold;
    margin-bottom: 24px;
}
</style>